# -*- coding: utf-8 -*-
#tdm config file

'''
tdm config
'''
tdm_type = ['power', 'network', 'server', 'mdm']
tdm_user_role = {'admin':'管理员', 'view':'普通用户'}
tdm_user_role_admin = 'admin'
tdm_user_online_tm = 1800

'''
database connection config
'''
tdm_redis_host = 'redis'    # use docker name of 'redis'
tdm_redis_port = 6379
tdm_redis_db = 1
tdm_mongo_host = 'mongo'    # use docker name of 'mongo'
tdm_mongo_port = 27017
tdm_mongo_db = 'tdm'
tdm_mongo_acard_db = 'acard'

'''
redis user config
'''
tdm_redis_key_user = 'config:user'
tdm_new_user_email = '''老师，你好：

您的电子考勤监控账号已经开通。

用户名是： %s
密码是： %s

监控系统地址：http://115.182.69.8:8103/tdm/main/

您在使用中有任何问题请及时与我联系
Email：qujianning@100tal.com
Phone: 18601377252
WeChat: redfox-qu
'''

'''
redis global config
'''
tdm_redis_key_jxd = 'config_jxd'
tdm_redis_key_jxd_dis = 'config_jxd_dis'
tdm_redis_key_power = 'config_power'
tdm_redis_key_server = 'config_server'
tdm_redis_key_network = 'config_network'
tdm_redis_key_mdm = 'config_mdm'
tdm_redis_key_alert = 'config_alert'

'''
redis server config
'''
tdm_redis_key_server_item_prefix = 'server_item'
tdm_redis_key_server_item_cfg = 'server_config'
tdm_redis_key_server_item_warn = 'server_warn'
tdm_redis_key_server_item_alert = 'server_alert'
tdm_redis_key_server_online_suffix = 'online'

'''
redis network config
'''
tdm_redis_key_network_item_prefix = 'network_item'
tdm_redis_key_network_item_cfg = 'network_config'
tdm_redis_key_network_item_warn = 'network_warn'
tdm_redis_key_network_item_alert = 'network_alert'
tdm_redis_key_network_online_suffix = 'online'

'''
redis mdm config
'''
tdm_redis_key_mdm_item_prefix = 'mdm_item'
tdm_redis_key_mdm_maclist_suffix = 'maclist'
tdm_redis_key_mdm_alive_suffix = 'alive'

'''
redis log config
'''
#1420609000266_network_北京_中础大厦_sw211_online_10
tdm_redis_key_log = 'log'

'''
redis problem config
'''
tdm_redis_key_prob = 'prob'


'''
redis alert config
'''
tdm_redis_key_alert_email = 'alert_send_email'
tdm_redis_key_alert_user = 'alert_email_user'
tdm_redis_key_alert_passwd = 'alert_email_passwd'
tdm_redis_key_alert_items = 'alert_items_send'
tdm_alert_authkey = 'tdm alert'
tdm_alert_localport = 8300
TDM_ALERT_RESEND = 24 * 60 * 60
TDM_ALERT_ALIVE_EX = 25 * 60 * 60
tdm_alert_sms = True
tdm_alert_sms_url = 'http://ismsy.speiyou.cn/interface/i/sendNoticeBatch'

'''
redis for venue_sync_log quick cache
'''
redis_venue_sync_log_prefix = "venue_sync_log"
redis_venue_sync_log_ex = 900   # 15 minitus

'''
redis for attend number count
'''
tdm_data_key_attend = 'data:attend'
tdm_data_attend_ctm = 'ctm'
tdm_data_attend_core = 'core'
tdm_data_attend_yewu = 'yewu'
tdm_data_attend_venue_core = 'venue:core'
tdm_data_attend_venue_ctm = 'venue:ctm'
tdm_attend_from_core_url = 'http://as.speiyou.com/attend/rest/attendweb/queryGroupByVenue.json'
tdm_attend_from_yewu_url = 'http://qt%s.card.speiyou.cn/admin/rest/optimize/prepareAttendance/queryProcedureByState.json'
tdm_attend_from_register_url = 'http://register.api.speiyou.cn/stone-register/lesson/queryLessonCount'
tdm_attend_venuegroup_url = 'http://as.speiyou.com/attend/rest/prepareAttendance/queryVenueListByVenueId'
'''
redis for autocmd config
'''
tdm_redis_autocmd_prefix = 'autocmd'
tdm_redis_autocmd_save_prefix = 'autocmd_save'